create function get_ChildDep(@ID int) returns @t_level table(id int,dep_serial int, level int)
as
begin
  declare @level int
  set @level = 1
  insert into @t_level select @id,@id , @level
  while @@ROWCOUNT > 0
  begin
    set @level = @level + 1
    insert into @t_level select @id,a.dep_serial, @level
    from dt_dep a , @t_Level b
    where a.dep_parent = b.dep_serial and b.level = @level - 1
  end
  return
end